package com.lizx.framework.web.smart.framework.core.helper;

import com.lizx.framework.web.smart.framework.core.utils.SmartPropUtils;

import java.util.Properties;

/**
 * 配置文件解析工具
 * @Author: lizx
 * @Description:
 * @Date: Create in 2019/1/17 3:16 PM
 */
public final class SmartConfigHelper {
    private static String CONFIG_FILE = "smart-framework.properties";

    private static String APP_BASE_PACKAGE = "smart.framework.app.base_package";

    private static String APP_JSP_PATH = "smart.framework.app.jsp_path";

    private static String APP_ASSERT_PATH = "smart.framework.app.asset_path";

    private static final Properties CONFIG_PROPERTIES = SmartPropUtils.loadProps(CONFIG_FILE);

    /**
     * 获取应用基础包
     * @return
     */
    public static String getAppBasePackage(){
        return SmartPropUtils.getString(CONFIG_PROPERTIES,APP_BASE_PACKAGE );
    }

    /**
     * 获取jsp路径
     * @return
     */
    public static String getAppJspPath(){
        return SmartPropUtils.getString(CONFIG_PROPERTIES, APP_JSP_PATH,"/WEB-INF/smartframework/jsp");
    }

    /**
     * 获取静态资源路径
     * @return
     */
    public static String getAppAssertPath(){
        return SmartPropUtils.getString(CONFIG_PROPERTIES, APP_ASSERT_PATH);
    }
}
